package com.knowledge.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
        import com.knowledge.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.knowledge.business.mapper.TPushDeviceMapper;
import com.knowledge.business.domain.TPushDevice;
import com.knowledge.business.service.ITPushDeviceService;

/**
 * 推送设备Service业务层处理
 *
 * @author zhaoyk
 * @date 2025-11-24
 */
@Service
public class TPushDeviceServiceImpl extends ServiceImpl<TPushDeviceMapper,TPushDevice>  implements ITPushDeviceService
{
    @Autowired
    private TPushDeviceMapper tPushDeviceMapper;

    /**
     * 查询推送设备
     *
     * @param id 推送设备主键
     * @return 推送设备
     */
    @Override
    public TPushDevice selectTPushDeviceById(String id)
    {
        return tPushDeviceMapper.selectTPushDeviceById(id);
    }

    /**
     * 查询推送设备列表
     *
     * @param tPushDevice 推送设备
     * @return 推送设备
     */
    @Override
    public List<TPushDevice> selectTPushDeviceList(TPushDevice tPushDevice)
    {
        return tPushDeviceMapper.selectTPushDeviceList(tPushDevice);
    }

    /**
     * 新增推送设备
     *
     * @param tPushDevice 推送设备
     * @return 结果
     */
    @Override
    public int insertTPushDevice(TPushDevice tPushDevice)
    {
                tPushDevice.setCreateTime(DateUtils.getNowDate());
            return tPushDeviceMapper.insertTPushDevice(tPushDevice);
    }

    /**
     * 修改推送设备
     *
     * @param tPushDevice 推送设备
     * @return 结果
     */
    @Override
    public int updateTPushDevice(TPushDevice tPushDevice)
    {
                tPushDevice.setUpdateTime(DateUtils.getNowDate());
        return tPushDeviceMapper.updateTPushDevice(tPushDevice);
    }

    /**
     * 批量删除推送设备
     *
     * @param ids 需要删除的推送设备主键
     * @return 结果
     */
    @Override
    public int deleteTPushDeviceByIds(String[] ids)
    {
        return tPushDeviceMapper.deleteTPushDeviceByIds(ids);
    }

    /**
     * 删除推送设备信息
     *
     * @param id 推送设备主键
     * @return 结果
     */
    @Override
    public int deleteTPushDeviceById(String id)
    {
        return tPushDeviceMapper.deleteTPushDeviceById(id);
    }
}
